package testing;

import static org.junit.Assert.*;
import org.junit.Test;

import database.HyPeerWebDatabase;
import hypeerweb.SimplifiedNodeDomain;

/**
 * A class designed to test HyPeerWebDatabase
 *
 * @author brinkerhoff_kendra
 */
public class HyPeerWebDatabaseTest {

	@Test
	public void testGetSingleton() {
		HyPeerWebDatabase.initHyPeerWebDatabase("default.db");
		HyPeerWebDatabase h1 = HyPeerWebDatabase.getSingleton();
		HyPeerWebDatabase h2 = HyPeerWebDatabase.getSingleton();
		assertTrue(h1 == h2);
	}

	@Test
	public void testGetNode() {
		HyPeerWebDatabase.initHyPeerWebDatabase("default.db");
		HyPeerWebDatabase h1 = HyPeerWebDatabase.getSingleton();
		
		try {
			/*SimplifiedNodeDomain n0 = h1.getNode(0);
			
			assertTrue(n0.getWebId() == 0);
			assertTrue(n0.getFold() == 1);
			assertTrue(n0.getSurrogateFold() == 1);
			assertTrue(n0.getNeighbors().size() == 2);
			assertTrue(n0.getUpPointers().size() == 0);
			assertTrue(n0.getDownPointers().size() == 0);
			*/
		} catch (Exception e) {
			assertTrue(false);
		}
	}
}
